home *** CD-ROM | disk | FTP | other *** search
/ Visual Cafe 3 / Visual Cafe 3.ISO / Vcafe / Sample.bin / SimpleFrame.java < prev    next >
Text File  |  1998-09-28  |  2KB  |  78 lines

  1. /*
  2.         A GUI version of the SimpleExampmle example from Sun that shows off the different
  3.         looks & feels. It uses a sublclass of JLookAndFeelComboBox instead of radio buttons.
  4.         
  5. */
  6.  
  7. import com.sun.java.swing.*;
  8. import java.awt.*;
  9. import com.symantec.itools.swing.JLookAndFeelComboBox;
  10.  
  11. public class SimpleFrame extends com.sun.java.swing.JFrame
  12. {
  13.     public SimpleFrame()
  14.     {
  15.         // This code is automatically generated by Visual Cafe when you add
  16.         // components to the visual environment. It instantiates and initializes
  17.         // the components. To modify the code, only use code syntax that matches
  18.         // what Visual Cafe can generate, or Visual Cafe may be unable to back
  19.         // parse your Java file into its visual environment.
  20.         //{{INIT_CONTROLS
  21.         setTitle("");
  22.         getContentPane().setLayout(new FlowLayout(FlowLayout.CENTER,5,5));
  23.         getContentPane().setFont(new Font("Dialog", Font.PLAIN, 0));
  24.         setSize(333,50);
  25.         setVisible(false);
  26.         JButton1.setText("Hello, world!");
  27.         JButton1.setActionCommand("Hello, world!");
  28.         JButton1.setMnemonic((int)'H');
  29.         getContentPane().add(JButton1);
  30.         JButton1.setBounds(69,5,103,25);
  31.         JLookAndFeelAndPackFrameComboBox1.setRequestFocusEnabled(false);
  32.         getContentPane().add(JLookAndFeelAndPackFrameComboBox1);
  33.         JLookAndFeelAndPackFrameComboBox1.setBounds(177,5,86,24);
  34.         JLookAndFeelAndPackFrameComboBox1.setSelectedIndex(0);
  35.         //}}
  36.         
  37.         pack();
  38.         
  39.         //{{INIT_MENUS
  40.         //}}
  41.     
  42.         //{{REGISTER_LISTENERS
  43.         SymWindow aSymWindow = new SymWindow();
  44.         this.addWindowListener(aSymWindow);
  45.         //}}
  46.     }
  47.  
  48.     static public void main(String args[])
  49.     {
  50.         SimpleFrame sf = new SimpleFrame();
  51.         sf.setLocation(50, 50);
  52.         sf.setVisible(true);
  53.     }
  54.  
  55.     //{{DECLARE_CONTROLS
  56.     com.sun.java.swing.JButton JButton1 = new com.sun.java.swing.JButton();
  57.     JLookAndFeelAndPackFrameComboBox JLookAndFeelAndPackFrameComboBox1 = new JLookAndFeelAndPackFrameComboBox();
  58.     //}}
  59.  
  60.     //{{DECLARE_MENUS
  61.     //}}
  62.  
  63.  
  64.     class SymWindow extends java.awt.event.WindowAdapter
  65.     {
  66.         public void windowClosing(java.awt.event.WindowEvent event)
  67.         {
  68.             Object object = event.getSource();
  69.             if (object == SimpleFrame.this)
  70.                 SimpleFrame_windowClosing(event);
  71.         }
  72.     }
  73.  
  74.     void SimpleFrame_windowClosing(java.awt.event.WindowEvent event)
  75.     {
  76.         System.exit(0);
  77.     }
  78. }